package net.xdclass.execption;

import lombok.Data;
import net.xdclass.enums.BizCodeEnum;

/**
 * @Author: fengh
 * @Date: 2023/6/14 17:19
 */
@Data
public class BizException extends RuntimeException {
    private Integer  code;
    private String msg;


    public BizException(BizCodeEnum bizCodeEnum) {
        super(bizCodeEnum.getMessage());
        this.code = bizCodeEnum.getCode();
        this.msg = bizCodeEnum.getMessage();
    }

    public BizException(Integer code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }
}
